package cn.kivensoft.util;

import org.slf4j.spi.LocationAwareLogger;

public enum LogLevel {
	trace(LocationAwareLogger.TRACE_INT),
	debug(LocationAwareLogger.DEBUG_INT),
	info(LocationAwareLogger.INFO_INT),
	warn(LocationAwareLogger.WARN_INT),
	error(LocationAwareLogger.ERROR_INT);

	private final int _level;

	LogLevel(int level) { _level = level; }

	public int level() { return _level; }

	public static LogLevel from(int level) {
		for (LogLevel l : values())
			if (l._level == level) return l;
		return null;
	}
}
